package com.downhometech.productcalculator.models;

import java.io.Serializable;

import android.content.ContentValues;
import android.database.Cursor;

public class Setting implements Serializable
{
	public static final int DEFAULT_TAX_RATE_ID = 1;
	public static final int DEFAULT_SHIPPING_RATE_ID = 2;
	public static final int DEFAULT_TAX_RATE_IS_PERCENT_ID = 3;
	public static final int DEFAULT_SHIPPING_RATE_IS_PERCENT_ID = 4;
	public static final int CHECKOUT_DESCRIPTION = 5;
		
	private int id = 0;
	private String name = "";
	private String value = "";
	
	
	public Setting(Cursor databaseCursor)
	{
        this.setId(databaseCursor.getInt(databaseCursor.getColumnIndex("id")));
        this.setName(databaseCursor.getString(databaseCursor.getColumnIndex("name")));
        this.setValue(databaseCursor.getString(databaseCursor.getColumnIndex("value")));
	}
	
	public Setting(int id, String name, String value)
	{
		this.id = id;
		this.name = name;
		this.value = value;
	}
		
	public ContentValues toContentValue()
	{
		ContentValues value = new ContentValues();
		value.put("id", this.id);
		value.put("name", this.name);
		value.put("value", this.value);
		return value;
	}
	
	public Setting() { }
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}
	
	
}
